home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / CIncludes / OCEMessaging.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-18  |  34.6 KB  |  1,226 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        OCEMessaging.h
  3.  
  4.      Contains:    Apple Open Collaboration Environment Messaging Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __OCEMESSAGING__
  21. #define __OCEMESSAGING__
  22.  
  23.  
  24. #ifndef __APPLEEVENTS__
  25. #include <AppleEvents.h>
  26. #endif
  27. /*    #include <Errors.h>                                            */
  28. /*        #include <ConditionalMacros.h>                            */
  29. /*    #include <Types.h>                                            */
  30. /*    #include <Memory.h>                                            */
  31. /*        #include <MixedMode.h>                                    */
  32. /*    #include <OSUtils.h>                                        */
  33. /*    #include <Events.h>                                            */
  34. /*        #include <Quickdraw.h>                                    */
  35. /*            #include <QuickdrawText.h>                            */
  36. /*    #include <EPPC.h>                                            */
  37. /*        #include <AppleTalk.h>                                    */
  38. /*        #include <Files.h>                                        */
  39. /*        #include <PPCToolbox.h>                                    */
  40. /*        #include <Processes.h>                                    */
  41. /*    #include <Notification.h>                                    */
  42.  
  43. #ifndef __FILES__
  44. #include <Files.h>
  45. #endif
  46.  
  47. #ifndef __TYPES__
  48. #include <Types.h>
  49. #endif
  50.  
  51. #ifndef __DIGITALSIGNATURE__
  52. #include <DigitalSignature.h>
  53. #endif
  54.  
  55. #ifndef __OCE__
  56. #include <OCE.h>
  57. #endif
  58. /*    #include <Aliases.h>                                        */
  59. /*    #include <Script.h>                                            */
  60. /*        #include <IntlResources.h>                                */
  61.  
  62. #ifndef __OCEAUTHDIR__
  63. #include <OCEAuthDir.h>
  64. #endif
  65.  
  66. #ifdef __cplusplus
  67. extern "C" {
  68. #endif
  69.  
  70. #if PRAGMA_ALIGN_SUPPORTED
  71. #pragma options align=mac68k
  72. #endif
  73.  
  74. #if PRAGMA_IMPORT_SUPPORTED
  75. #pragma import on
  76. #endif
  77.  
  78.  
  79. enum {
  80.     kIPMAnyPriority                = 0,                            /* FOR FILTER ONLY */
  81.     kIPMNormalPriority            = 1,
  82.     kIPMLowPriority,
  83.     kIPMHighPriority
  84. };
  85.  
  86. typedef Byte IPMPriority;
  87.  
  88.  
  89. enum {
  90.     kIPMAtMark,
  91.     kIPMFromStart,
  92.     kIPMFromLEOM,
  93.     kIPMFromMark
  94. };
  95.  
  96. typedef unsigned short IPMAccessMode;
  97.  
  98.  
  99. enum {
  100.     kIPMUpdateMsgBit            = 4,
  101.     kIPMNewMsgBit                = 5,
  102.     kIPMDeleteMsgBit            = 6
  103. };
  104.  
  105. /* Values of IPMNotificationType */
  106. enum {
  107.     kIPMUpdateMsgMask            = 1 << kIPMUpdateMsgBit,
  108.     kIPMNewMsgMask                = 1 << kIPMNewMsgBit,
  109.     kIPMDeleteMsgMask            = 1 << kIPMDeleteMsgBit
  110. };
  111.  
  112. typedef Byte IPMNotificationType;
  113.  
  114.  
  115. enum {
  116.     kIPMSenderRStringTag,
  117.     kIPMSenderRecordIDTag
  118. };
  119.  
  120. typedef unsigned short IPMSenderTag;
  121.  
  122.  
  123. enum {
  124.     kIPMFromDistListBit            = 0,
  125.     kIPMDummyRecBit                = 1,
  126.     kIPMFeedbackRecBit            = 2,                            /* should be redirected to feedback queue */
  127.     kIPMReporterRecBit            = 3,                            /* should be redirected to reporter original queue */
  128.     kIPMBCCRecBit                = 4                                /* this recipient is blind to all recipients of message */
  129. };
  130.  
  131. /* Values of OCERecipientOffsetFlags */
  132. enum {
  133.     kIPMFromDistListMask        = 1 << kIPMFromDistListBit,
  134.     kIPMDummyRecMask            = 1 << kIPMDummyRecBit,
  135.     kIPMFeedbackRecMask            = 1 << kIPMFeedbackRecBit,
  136.     kIPMReporterRecMask            = 1 << kIPMReporterRecBit,
  137.     kIPMBCCRecMask                = 1 << kIPMBCCRecBit
  138. };
  139.  
  140. typedef Byte OCERecipientOffsetFlags;
  141.  
  142. struct OCECreatorType {
  143.     OSType                            msgCreator;
  144.     OSType                            msgType;
  145. };
  146. typedef struct OCECreatorType OCECreatorType;
  147.  
  148.  
  149. enum {
  150.     kIPMTypeWildCard            = 'ipmw',
  151.     kIPMFamilyUnspecified        = 0,
  152.     kIPMFamilyWildCard            = 0x3F3F3F3FL,                    /* '??^ 
  153.  
  154.     * well known signature */
  155.     kIPMSignature                = 'ipms',                        /* base type 
  156.  
  157.     * well known message types */
  158.     kIPMReportNotify            = 'rptn',                        /* routing feedback
  159.  
  160.     * well known message block types */
  161.     kIPMEnclosedMsgType            = 'emsg',                        /* enclosed (nested) message */
  162.     kIPMReportInfo                = 'rpti',                        /* recipient information */
  163.     kIPMDigitalSignature        = 'dsig'
  164. };
  165.  
  166. /* Values of IPMMsgFormat */
  167. enum {
  168.     kIPMOSFormatType            = 1,
  169.     kIPMStringFormatType        = 2
  170. };
  171.  
  172. typedef unsigned short IPMMsgFormat;
  173.  
  174. typedef Str32 IPMStringMsgType;
  175.  
  176. union TheType {
  177.     OCECreatorType                    msgOSType;
  178.     IPMStringMsgType                msgStrType;
  179. };
  180. typedef union TheType TheType;
  181.  
  182. struct IPMMsgType {
  183.     IPMMsgFormat                    format;                        /* IPMMsgFormat*/
  184.     TheType                            theType;
  185. };
  186. typedef struct IPMMsgType IPMMsgType;
  187.  
  188. /*
  189. Following are the known extension values for IPM addresses handled by Apple.
  190. We define the definition of the entn extension below.
  191. */
  192.  
  193. enum {
  194.     kOCEalanXtn                    = 'alan',
  195.     kOCEentnXtn                    = 'entn',                        /* entn = entity name (aka DSSpec) */
  196.     kOCEaphnXtn                    = 'aphn'
  197. };
  198.  
  199. /*
  200. Following are the specific definitions for the extension for the standard
  201. OCEMail 'entn' addresses.  [Note, the actual extension is formatted as in
  202. IPMEntityNameExtension.]
  203. */
  204. /* entn extension forms */
  205. enum {
  206.     kOCEAddrXtn                    = 'addr',
  207.     kOCEQnamXtn                    = 'qnam',
  208.     kOCEAttrXtn                    = 'attr',                        /* an attribute specification */
  209.     kOCESpAtXtn                    = 'spat'
  210. };
  211.  
  212. /*
  213. Following are the specific definitions for standard
  214. OCEMail 'aphn' extension value.  
  215.  
  216. All RStrings here are packed (e.g. truncated to length) and even padded (e.g.
  217. if length odd, then a pad byte (zero) should be introduced before the next field).
  218.  
  219. The extension value is in the packed form of the following structure:
  220.     RString        phoneNumber;
  221.     RString        modemType;
  222.     Str32        queueuName;
  223.  
  224. The body of phoneNumber compound RString is in the packed form of the following structure:
  225.     short         subType;
  226.     RString     countryCode;                // used when subType == kOCEUseHandyDial
  227.     RString        areaCode;                    // used when subType == kOCEUseHandyDial
  228.     RString        phone;                        // used when subType == kOCEUseHandyDial
  229.     RString        postFix;                    // used when subType == kOCEUseHandyDial
  230.     RString        nonHandyDialString;            // used when subType == kOCEDontUseHandyDial
  231. */
  232. /* phoneNumber sub type constants */
  233. enum {
  234.     kOCEUseHandyDial            = 1,
  235.     kOCEDontUseHandyDial        = 2
  236. };
  237.  
  238. /* FORMAT OF A PACKED FORM RECIPIENT */
  239. #define OCEPackedRecipientHeader  \
  240.     unsigned short    dataLength;
  241. struct ProtoOCEPackedRecipient {
  242.     unsigned short                    dataLength;
  243. };
  244. typedef struct ProtoOCEPackedRecipient ProtoOCEPackedRecipient;
  245.  
  246.  
  247. enum {
  248.     kOCEPackedRecipientMaxBytes    = (4096 - sizeof(ProtoOCEPackedRecipient))
  249. };
  250.  
  251. struct OCEPackedRecipient {
  252.     unsigned short                    dataLength;
  253.     Byte                            data[kOCEPackedRecipientMaxBytes];
  254. };
  255. typedef struct OCEPackedRecipient OCEPackedRecipient;
  256.  
  257. struct IPMEntnQueueExtension {
  258.     Str32                            queueName;
  259. };
  260. typedef struct IPMEntnQueueExtension IPMEntnQueueExtension;
  261.  
  262. /* kOCEAttrXtn */
  263. struct IPMEntnAttributeExtension {
  264.     AttributeType                    attributeName;
  265. };
  266. typedef struct IPMEntnAttributeExtension IPMEntnAttributeExtension;
  267.  
  268. /* kOCESpAtXtn */
  269. struct IPMEntnSpecificAttributeExtension {
  270.     AttributeCreationID                attributeCreationID;
  271.     AttributeType                    attributeName;
  272. };
  273. typedef struct IPMEntnSpecificAttributeExtension IPMEntnSpecificAttributeExtension;
  274.  
  275. /* All IPM entn extensions fit within the following */
  276. struct IPMEntityNameExtension {
  277.     OSType                            subExtensionType;
  278.     union {
  279.         IPMEntnSpecificAttributeExtension specificAttribute;
  280.         IPMEntnAttributeExtension        attribute;
  281.         IPMEntnQueueExtension            queue;
  282.     }                                u;
  283. };
  284. typedef struct IPMEntityNameExtension IPMEntityNameExtension;
  285.  
  286. /* addresses with kIPMNBPXtn should specify this nbp type */
  287. #define kIPMWSReceiverNBPType "pMsgReceiver" 
  288. struct IPMMsgID {
  289.     unsigned long                    id[4];
  290. };
  291. typedef struct IPMMsgID IPMMsgID;
  292.  
  293. /* Values of IPMHeaderSelector */
  294.  
  295. enum {
  296.     kIPMTOC                        = 0,
  297.     kIPMSender                    = 1,
  298.     kIPMProcessHint                = 2,
  299.     kIPMMessageTitle            = 3,
  300.     kIPMMessageType                = 4,
  301.     kIPMFixedInfo                = 7
  302. };
  303.  
  304. typedef Byte IPMHeaderSelector;
  305.  
  306. union TheSender {
  307.     RString                            rString;
  308.     PackedRecordID                    rid;
  309. };
  310. typedef union TheSender TheSender;
  311.  
  312. struct IPMSender {
  313.     IPMSenderTag                    sendTag;
  314.     TheSender                        theSender;
  315. };
  316. typedef struct IPMSender IPMSender;
  317.  
  318. typedef DSSpec OCERecipient;
  319.  
  320. /******************************************************************************/
  321. /* Definitions specific to OCEMessaging */
  322. typedef unsigned long IPMContextRef;
  323.  
  324. typedef unsigned long IPMQueueRef;
  325.  
  326. typedef unsigned long IPMMsgRef;
  327.  
  328. typedef unsigned long IPMSeqNum;
  329.  
  330. typedef Str32 IPMProcHint;
  331.  
  332. typedef Str32 IPMQueueName;
  333.  
  334. typedef pascal void (*IPMNoteProcPtr)(IPMQueueRef queue, IPMSeqNum seqNum, IPMNotificationType notificationType, unsigned long userData);
  335.  
  336. #if GENERATINGCFM
  337. typedef UniversalProcPtr IPMNoteUPP;
  338. #else
  339. typedef IPMNoteProcPtr IPMNoteUPP;
  340. #endif
  341.  
  342. enum {
  343.     uppIPMNoteProcInfo = kPascalStackBased
  344.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(IPMQueueRef)))
  345.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(IPMSeqNum)))
  346.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(IPMNotificationType)))
  347.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(unsigned long)))
  348. };
  349.  
  350. #if GENERATINGCFM
  351. #define NewIPMNoteProc(userRoutine)        \
  352.         (IPMNoteUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIPMNoteProcInfo, GetCurrentArchitecture())
  353. #else
  354. #define NewIPMNoteProc(userRoutine)        \
  355.         ((IPMNoteUPP) (userRoutine))
  356. #endif
  357.  
  358. #if GENERATINGCFM
  359. #define CallIPMNoteProc(userRoutine, queue, seqNum, notificationType, userData)        \
  360.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIPMNoteProcInfo, (queue), (seqNum), (notificationType), (userData))
  361. #else
  362. #define CallIPMNoteProc(userRoutine, queue, seqNum, notificationType, userData)        \
  363.         (*(userRoutine))((queue), (seqNum), (notificationType), (userData))
  364. #endif
  365.  
  366. struct IPMFixedHdrInfo {
  367.     unsigned short                    version;
  368.     Boolean                            authenticated;
  369.     Boolean                            signatureEnclosed;            /*  digital signature enclosed */
  370.     unsigned long                    msgSize;
  371.     IPMNotificationType                notification;
  372.     IPMPriority                        priority;
  373.     unsigned short                    blockCount;
  374.     unsigned short                    originalRcptCount;            /*        original number of recipients */
  375.     unsigned long                    refCon;                        /*        Client defined data */
  376.     unsigned short                    reserved;
  377.     UTCTime                            creationTime;                /*        Time when it was created */
  378.     IPMMsgID                        msgID;
  379.     OSType                            family;                        /* family this msg belongs (e.g. mail) */
  380. };
  381. typedef struct IPMFixedHdrInfo IPMFixedHdrInfo;
  382.  
  383.  
  384. enum {
  385.     kIPMDeliveryNotificationBit    = 0,
  386.     kIPMNonDeliveryNotificationBit = 1,
  387.     kIPMEncloseOriginalBit        = 2,
  388.     kIPMSummaryReportBit        = 3,
  389. /* modify enclose original to only on error */
  390.     kIPMOriginalOnlyOnErrorBit    = 4
  391. };
  392.  
  393. enum {
  394.     kIPMNoNotificationMask        = 0x00,
  395.     kIPMDeliveryNotificationMask = 1 << kIPMDeliveryNotificationBit,
  396.     kIPMNonDeliveryNotificationMask = 1 << kIPMNonDeliveryNotificationBit,
  397.     kIPMDontEncloseOriginalMask    = 0x00,
  398.     kIPMEncloseOriginalMask        = 1 << kIPMEncloseOriginalBit,
  399.     kIPMImmediateReportMask        = 0x00,
  400.     kIPMSummaryReportMask        = 1 << kIPMSummaryReportBit,
  401.     kIPMOriginalOnlyOnErrorMask    = 1 << kIPMOriginalOnlyOnErrorBit,
  402.     kIPMEncloseOriginalOnErrorMask = (kIPMOriginalOnlyOnErrorMask | kIPMEncloseOriginalMask)
  403. };
  404.  
  405. enum {
  406.     kIPMNoSuchRecipient            = 0x0001,
  407.     kIPMRecipientMalformed        = 0x0002,
  408.     kIPMRecipientAmbiguous        = 0x0003,
  409.     kIPMRecipientAccessDenied    = 0x0004,
  410.     kIPMGroupExpansionProblem    = 0x0005,
  411.     kIPMMsgUnreadable            = 0x0006,
  412.     kIPMMsgExpired                = 0x0007,
  413.     kIPMMsgNoTranslatableContent = 0x0008,
  414.     kIPMRecipientReqStdCont        = 0x0009,
  415.     kIPMRecipientReqSnapShot    = 0x000A,
  416.     kIPMNoTransferDiskFull        = 0x000B,
  417.     kIPMNoTransferMsgRejectedbyDest = 0x000C,
  418.     kIPMNoTransferMsgTooLarge    = 0x000D
  419. };
  420.  
  421. /*************************************************************************/
  422. /*
  423. This is the structure that will be returned by enumerate and getmsginfo
  424. This definition is just to give you a template, the position of msgType
  425. is variable since this is a packed structure.  procHint and msgType are
  426. packed and even length padded.
  427.  
  428. * master message info */
  429. struct IPMMsgInfo {
  430.     IPMSeqNum                        sequenceNum;
  431.     unsigned long                    userData;
  432.     unsigned short                    respIndex;
  433.     SInt8                            padByte;
  434.     IPMPriority                        priority;
  435.     unsigned long                    msgSize;
  436.     unsigned short                    originalRcptCount;
  437.     unsigned short                    reserved;
  438.     UTCTime                            creationTime;
  439.     IPMMsgID                        msgID;
  440.     OSType                            family;                        /* family this msg belongs (e.g. mail) */
  441.     IPMProcHint                        procHint;
  442.     SInt8                            filler2;
  443.     IPMMsgType                        msgType;
  444. };
  445. typedef struct IPMMsgInfo IPMMsgInfo;
  446.  
  447. typedef OCECreatorType IPMBlockType;
  448.  
  449. struct IPMTOC {
  450.     IPMBlockType                    blockType;
  451.     long                            blockOffset;
  452.     unsigned long                    blockSize;
  453.     unsigned long                    blockRefCon;
  454. };
  455. typedef struct IPMTOC IPMTOC;
  456.  
  457. /*
  458. The following structure is just to describe the layout of the SingleFilter.
  459. Each field should be packed and word aligned when passed to the IPM ToolBox.
  460. */
  461. struct IPMSingleFilter {
  462.     IPMPriority                        priority;
  463.     SInt8                            padByte;
  464.     OSType                            family;                        /* family this msg belongs (e.g. mail), '??^ for all */
  465.     ScriptCode                        script;                        /* Language Identifier */
  466.     IPMProcHint                        hint;
  467.     SInt8                            filler2;
  468.     IPMMsgType                        msgType;
  469. };
  470. typedef struct IPMSingleFilter IPMSingleFilter;
  471.  
  472. struct IPMFilter {
  473.     unsigned short                    count;
  474.     IPMSingleFilter                    sFilters[1];
  475. };
  476. typedef struct IPMFilter IPMFilter;
  477.  
  478. /*************************************************************************
  479. Following structures define the “start” of a recipient report block and the
  480. elements of the array respectively.
  481. */
  482. struct IPMReportBlockHeader {
  483.     IPMMsgID                        msgID;                        /* message id of the original */
  484.     UTCTime                            creationTime;                /* creation time of the report */
  485. };
  486. typedef struct IPMReportBlockHeader IPMReportBlockHeader;
  487.  
  488. struct OCERecipientReport {
  489.     unsigned short                    rcptIndex;                    /* index of recipient in original message */
  490.     OSErr                            result;                        /* result of sending letter to this recipient*/
  491. };
  492. typedef struct OCERecipientReport OCERecipientReport;
  493.  
  494. /*************************************************************************/
  495. typedef union IPMParamBlock IPMParamBlock;
  496.  
  497. typedef IPMParamBlock *IPMParamBlockPtr;
  498.  
  499. typedef pascal void (*IPMIOCompletionProcPtr)(IPMParamBlockPtr paramBlock);
  500.  
  501. #if GENERATINGCFM
  502. typedef UniversalProcPtr IPMIOCompletionUPP;
  503. #else
  504. typedef IPMIOCompletionProcPtr IPMIOCompletionUPP;
  505. #endif
  506.  
  507. #define IPMParamHeader             \
  508.     Ptr    qLink;                        \
  509.     long    reservedH1;                \
  510.     long    reservedH2;                \
  511.     IPMIOCompletionUPP    ioCompletion;     \
  512.     OSErr    ioResult;                \
  513.     long    saveA5;                    \
  514.     short    reqCode;
  515. struct IPMOpenContextPB {
  516.     Ptr                                qLink;
  517.     long                            reservedH1;
  518.     long                            reservedH2;
  519.     IPMIOCompletionUPP                ioCompletion;
  520.     OSErr                            ioResult;
  521.     long                            saveA5;
  522.     short                            reqCode;
  523.     IPMContextRef                    contextRef;                    /* <--  Context reference to be used in further calls*/
  524. };
  525. typedef struct IPMOpenContextPB IPMOpenContextPB;
  526.  
  527. typedef IPMOpenContextPB IPMCloseContextPB;
  528.  
  529. struct IPMCreateQueuePB {
  530.     Ptr                                qLink;
  531.     long                            reservedH1;
  532.     long                            reservedH2;
  533.     IPMIOCompletionUPP                ioCompletion;
  534.     OSErr                            ioResult;
  535.     long                            saveA5;
  536.     short                            reqCode;
  537.     long                            filler1;
  538.     OCERecipient                    *queue;
  539.     AuthIdentity                    identity;                    /* used only if queue is remote */
  540.     PackedRecordID                    *owner;                        /* used only if queue is remote */
  541. };
  542. typedef struct IPMCreateQueuePB IPMCreateQueuePB;
  543.  
  544. /* For createqueue and deletequeue only queue and identity are used */
  545. typedef IPMCreateQueuePB IPMDeleteQueuePB;
  546.  
  547. struct IPMOpenQueuePB {
  548.     Ptr                                qLink;
  549.     long                            reservedH1;
  550.     long                            reservedH2;
  551.     IPMIOCompletionUPP                ioCompletion;
  552.     OSErr                            ioResult;
  553.     long                            saveA5;
  554.     short                            reqCode;
  555.     IPMContextRef                    contextRef;
  556.     OCERecipient                    *queue;
  557.     AuthIdentity                    identity;
  558.     IPMFilter                        *filter;
  559.     IPMQueueRef                        newQueueRef;
  560.     IPMNoteUPP                        notificationProc;
  561.     unsigned long                    userData;
  562.     IPMNotificationType                noteType;
  563.     Byte                            padByte;
  564.     long                            reserved;
  565.     long                            reserved2;
  566. };
  567. typedef struct IPMOpenQueuePB IPMOpenQueuePB;
  568.  
  569. struct IPMCloseQueuePB {
  570.     Ptr                                qLink;
  571.     long                            reservedH1;
  572.     long                            reservedH2;
  573.     IPMIOCompletionUPP                ioCompletion;
  574.     OSErr                            ioResult;
  575.     long                            saveA5;
  576.     short                            reqCode;
  577.     IPMQueueRef                        queueRef;
  578. };
  579. typedef struct IPMCloseQueuePB IPMCloseQueuePB;
  580.  
  581. struct IPMEnumerateQueuePB {
  582.     Ptr                                qLink;
  583.     long                            reservedH1;
  584.     long                            reservedH2;
  585.     IPMIOCompletionUPP                ioCompletion;
  586.     OSErr                            ioResult;
  587.     long                            saveA5;
  588.     short                            reqCode;
  589.     IPMQueueRef                        queueRef;
  590.     IPMSeqNum                        startSeqNum;
  591.     Boolean                            getProcHint;
  592.     Boolean                            getMsgType;
  593.     short                            filler;
  594.     IPMFilter                        *filter;
  595.     unsigned short                    numToGet;
  596.     unsigned short                    numGotten;
  597.     unsigned long                    enumCount;
  598.     Ptr                                enumBuffer;                    /* will be packed array of IPMMsgInfo */
  599.     unsigned long                    actEnumCount;
  600. };
  601. typedef struct IPMEnumerateQueuePB IPMEnumerateQueuePB;
  602.  
  603. typedef IPMEnumerateQueuePB IPMChangeQueueFilterPB;
  604.  
  605. struct IPMDeleteMsgRangePB {
  606.     Ptr                                qLink;
  607.     long                            reservedH1;
  608.     long                            reservedH2;
  609.     IPMIOCompletionUPP                ioCompletion;
  610.     OSErr                            ioResult;
  611.     long                            saveA5;
  612.     short                            reqCode;
  613.     IPMQueueRef                        queueRef;
  614.     IPMSeqNum                        startSeqNum;
  615.     IPMSeqNum                        endSeqNum;
  616.     IPMSeqNum                        lastSeqNum;
  617. };
  618. typedef struct IPMDeleteMsgRangePB IPMDeleteMsgRangePB;
  619.  
  620. struct IPMOpenMsgPB {
  621.     Ptr                                qLink;
  622.     long                            reservedH1;
  623.     long                            reservedH2;
  624.     IPMIOCompletionUPP                ioCompletion;
  625.     OSErr                            ioResult;
  626.     long                            saveA5;
  627.     short                            reqCode;
  628.     IPMQueueRef                        queueRef;
  629.     IPMSeqNum                        sequenceNum;
  630.     IPMMsgRef                        newMsgRef;
  631.     IPMSeqNum                        actualSeqNum;
  632.     Boolean                            exactMatch;
  633.     Byte                            padByte;
  634.     long                            reserved;
  635. };
  636. typedef struct IPMOpenMsgPB IPMOpenMsgPB;
  637.  
  638. struct IPMOpenHFSMsgPB {
  639.     Ptr                                qLink;
  640.     long                            reservedH1;
  641.     long                            reservedH2;
  642.     IPMIOCompletionUPP                ioCompletion;
  643.     OSErr                            ioResult;
  644.     long                            saveA5;
  645.     short                            reqCode;
  646.     FSSpec                            *hfsPath;
  647.     long                            filler;
  648.     IPMMsgRef                        newMsgRef;
  649.     long                            filler2;
  650.     Byte                            filler3;
  651.     Boolean                            filler4;
  652.     long                            reserved;
  653. };
  654. typedef struct IPMOpenHFSMsgPB IPMOpenHFSMsgPB;
  655.  
  656. struct IPMOpenBlockAsMsgPB {
  657.     Ptr                                qLink;
  658.     long                            reservedH1;
  659.     long                            reservedH2;
  660.     IPMIOCompletionUPP                ioCompletion;
  661.     OSErr                            ioResult;
  662.     long                            saveA5;
  663.     short                            reqCode;
  664.     IPMMsgRef                        msgRef;
  665.     unsigned long                    filler;
  666.     IPMMsgRef                        newMsgRef;
  667.     unsigned short                    filler2[7];
  668.     unsigned short                    blockIndex;
  669. };
  670. typedef struct IPMOpenBlockAsMsgPB IPMOpenBlockAsMsgPB;
  671.  
  672. struct IPMCloseMsgPB {
  673.     Ptr                                qLink;
  674.     long                            reservedH1;
  675.     long                            reservedH2;
  676.     IPMIOCompletionUPP                ioCompletion;
  677.     OSErr                            ioResult;
  678.     long                            saveA5;
  679.     short                            reqCode;
  680.     IPMMsgRef                        msgRef;
  681.     Boolean                            deleteMsg;
  682.     Boolean                            filler1;
  683. };
  684. typedef struct IPMCloseMsgPB IPMCloseMsgPB;
  685.  
  686. struct IPMGetMsgInfoPB {
  687.     Ptr                                qLink;
  688.     long                            reservedH1;
  689.     long                            reservedH2;
  690.     IPMIOCompletionUPP                ioCompletion;
  691.     OSErr                            ioResult;
  692.     long                            saveA5;
  693.     short                            reqCode;
  694.     IPMMsgRef                        msgRef;
  695.     IPMMsgInfo                        *info;
  696. };
  697. typedef struct IPMGetMsgInfoPB IPMGetMsgInfoPB;
  698.  
  699. struct IPMReadHeaderPB {
  700.     Ptr                                qLink;
  701.     long                            reservedH1;
  702.     long                            reservedH2;
  703.     IPMIOCompletionUPP                ioCompletion;
  704.     OSErr                            ioResult;
  705.     long                            saveA5;
  706.     short                            reqCode;
  707.     IPMMsgRef                        msgRef;
  708.     unsigned short                    fieldSelector;
  709.     long                            offset;
  710.     unsigned long                    count;
  711.     Ptr                                buffer;
  712.     unsigned long                    actualCount;
  713.     unsigned short                    filler;
  714.     unsigned long                    remaining;
  715. };
  716. typedef struct IPMReadHeaderPB IPMReadHeaderPB;
  717.  
  718. struct IPMReadRecipientPB {
  719.     Ptr                                qLink;
  720.     long                            reservedH1;
  721.     long                            reservedH2;
  722.     IPMIOCompletionUPP                ioCompletion;
  723.     OSErr                            ioResult;
  724.     long                            saveA5;
  725.     short                            reqCode;
  726.     IPMMsgRef                        msgRef;
  727.     unsigned short                    rcptIndex;
  728.     long                            offset;
  729.     unsigned long                    count;
  730.     Ptr                                buffer;
  731.     unsigned long                    actualCount;
  732.     short                            reserved;                    /* must be zero */
  733.     unsigned long                    remaining;
  734.     unsigned short                    originalIndex;
  735.     OCERecipientOffsetFlags            recipientOffsetFlags;
  736.     Boolean                            filler1;
  737. };
  738. typedef struct IPMReadRecipientPB IPMReadRecipientPB;
  739.  
  740. /*
  741. replyQueue works like recipient. [can no longer read it via ReadHeader]
  742. OriginalIndex is meaningless, rcptFlags are used seperately and there are
  743. currently none defined.
  744. */
  745. typedef IPMReadRecipientPB IPMReadReplyQueuePB;
  746.  
  747. struct IPMGetBlkIndexPB {
  748.     Ptr                                qLink;
  749.     long                            reservedH1;
  750.     long                            reservedH2;
  751.     IPMIOCompletionUPP                ioCompletion;
  752.     OSErr                            ioResult;
  753.     long                            saveA5;
  754.     short                            reqCode;
  755.     IPMMsgRef                        msgRef;
  756.     IPMBlockType                    blockType;
  757.     unsigned short                    index;
  758.     unsigned short                    startingFrom;
  759.     IPMBlockType                    actualBlockType;
  760.     unsigned short                    actualBlockIndex;
  761. };
  762. typedef struct IPMGetBlkIndexPB IPMGetBlkIndexPB;
  763.  
  764. struct IPMReadMsgPB {
  765.     Ptr                                qLink;
  766.     long                            reservedH1;
  767.     long                            reservedH2;
  768.     IPMIOCompletionUPP                ioCompletion;
  769.     OSErr                            ioResult;
  770.     long                            saveA5;
  771.     short                            reqCode;
  772.     IPMMsgRef                        msgRef;
  773.     IPMAccessMode                    mode;
  774.     long                            offset;
  775.     unsigned long                    count;
  776.     Ptr                                buffer;
  777.     unsigned long                    actualCount;
  778.     unsigned short                    blockIndex;
  779.     unsigned long                    remaining;
  780. };
  781. typedef struct IPMReadMsgPB IPMReadMsgPB;
  782.  
  783. struct IPMVerifySignaturePB {
  784.     Ptr                                qLink;
  785.     long                            reservedH1;
  786.     long                            reservedH2;
  787.     IPMIOCompletionUPP                ioCompletion;
  788.     OSErr                            ioResult;
  789.     long                            saveA5;
  790.     short                            reqCode;
  791.     IPMMsgRef                        msgRef;
  792.     SIGContextPtr                    signatureContext;
  793. };
  794. typedef struct IPMVerifySignaturePB IPMVerifySignaturePB;
  795.  
  796. struct IPMNewMsgPB {
  797.     Ptr                                qLink;
  798.     long                            reservedH1;
  799.     long                            reservedH2;
  800.     IPMIOCompletionUPP                ioCompletion;
  801.     OSErr                            ioResult;
  802.     long                            saveA5;
  803.     short                            reqCode;
  804.     unsigned long                    filler;
  805.     OCERecipient                    *recipient;
  806.     OCERecipient                    *replyQueue;
  807.     StringPtr                        procHint;
  808.     unsigned short                    filler2;
  809.     IPMMsgType                        *msgType;
  810.     unsigned long                    refCon;
  811.     IPMMsgRef                        newMsgRef;
  812.     unsigned short                    filler3;
  813.     long                            filler4;
  814.     AuthIdentity                    identity;
  815.     IPMSender                        *sender;
  816.     unsigned long                    internalUse;
  817.     unsigned long                    internalUse2;
  818. };
  819. typedef struct IPMNewMsgPB IPMNewMsgPB;
  820.  
  821. struct IPMNewHFSMsgPB {
  822.     Ptr                                qLink;
  823.     long                            reservedH1;
  824.     long                            reservedH2;
  825.     IPMIOCompletionUPP                ioCompletion;
  826.     OSErr                            ioResult;
  827.     long                            saveA5;
  828.     short                            reqCode;
  829.     FSSpec                            *hfsPath;
  830.     OCERecipient                    *recipient;
  831.     OCERecipient                    *replyQueue;
  832.     StringPtr                        procHint;
  833.     unsigned short                    filler2;
  834.     IPMMsgType                        *msgType;
  835.     unsigned long                    refCon;
  836.     IPMMsgRef                        newMsgRef;
  837.     unsigned short                    filler3;
  838.     long                            filler4;
  839.     AuthIdentity                    identity;
  840.     IPMSender                        *sender;
  841.     unsigned long                    internalUse;
  842.     unsigned long                    internalUse2;
  843. };
  844. typedef struct IPMNewHFSMsgPB IPMNewHFSMsgPB;
  845.  
  846. struct IPMNestMsgPB {
  847.     Ptr                                qLink;
  848.     long                            reservedH1;
  849.     long                            reservedH2;
  850.     IPMIOCompletionUPP                ioCompletion;
  851.     OSErr                            ioResult;
  852.     long                            saveA5;
  853.     short                            reqCode;
  854.     IPMMsgRef                        msgRef;
  855.     unsigned short                    filler[9];
  856.     unsigned long                    refCon;
  857.     IPMMsgRef                        msgToNest;
  858.     unsigned short                    filler2;
  859.     long                            startingOffset;
  860. };
  861. typedef struct IPMNestMsgPB IPMNestMsgPB;
  862.  
  863. struct IPMNewNestedMsgBlockPB {
  864.     Ptr                                qLink;
  865.     long                            reservedH1;
  866.     long                            reservedH2;
  867.     IPMIOCompletionUPP                ioCompletion;
  868.     OSErr                            ioResult;
  869.     long                            saveA5;
  870.     short                            reqCode;
  871.     IPMMsgRef                        msgRef;
  872.     OCERecipient                    *recipient;
  873.     OCERecipient                    *replyQueue;
  874.     StringPtr                        procHint;
  875.     unsigned short                    filler1;
  876.     IPMMsgType                        *msgType;
  877.     unsigned long                    refCon;
  878.     IPMMsgRef                        newMsgRef;
  879.     unsigned short                    filler2;
  880.     long                            startingOffset;
  881.     AuthIdentity                    identity;
  882.     IPMSender                        *sender;
  883.     unsigned long                    internalUse;
  884.     unsigned long                    internalUse2;
  885. };
  886. typedef struct IPMNewNestedMsgBlockPB IPMNewNestedMsgBlockPB;
  887.  
  888. struct IPMEndMsgPB {
  889.     Ptr                                qLink;
  890.     long                            reservedH1;
  891.     long                            reservedH2;
  892.     IPMIOCompletionUPP                ioCompletion;
  893.     OSErr                            ioResult;
  894.     long                            saveA5;
  895.     short                            reqCode;
  896.     IPMMsgRef                        msgRef;
  897.     IPMMsgID                        msgID;
  898.     RString                            *msgTitle;
  899.     IPMNotificationType                deliveryNotification;
  900.     IPMPriority                        priority;
  901.     Boolean                            cancel;
  902.     Byte                            padByte;
  903.     long                            reserved;
  904.     SIGSignaturePtr                    signature;
  905.     Size                            signatureSize;
  906.     SIGContextPtr                    signatureContext;
  907. /* family this msg belongs (e.g. mail) use kIPMFamilyUnspecified by default */
  908.     OSType                            family;
  909. };
  910. typedef struct IPMEndMsgPB IPMEndMsgPB;
  911.  
  912. struct IPMAddRecipientPB {
  913.     Ptr                                qLink;
  914.     long                            reservedH1;
  915.     long                            reservedH2;
  916.     IPMIOCompletionUPP                ioCompletion;
  917.     OSErr                            ioResult;
  918.     long                            saveA5;
  919.     short                            reqCode;
  920.     IPMMsgRef                        msgRef;
  921.     OCERecipient                    *recipient;
  922.     long                            reserved;
  923. };
  924. typedef struct IPMAddRecipientPB IPMAddRecipientPB;
  925.  
  926. struct IPMAddReplyQueuePB {
  927.     Ptr                                qLink;
  928.     long                            reservedH1;
  929.     long                            reservedH2;
  930.     IPMIOCompletionUPP                ioCompletion;
  931.     OSErr                            ioResult;
  932.     long                            saveA5;
  933.     short                            reqCode;
  934.     IPMMsgRef                        msgRef;
  935.     long                            filler;
  936.     OCERecipient                    *replyQueue;
  937. };
  938. typedef struct IPMAddReplyQueuePB IPMAddReplyQueuePB;
  939.  
  940. struct IPMNewBlockPB {
  941.     Ptr                                qLink;
  942.     long                            reservedH1;
  943.     long                            reservedH2;
  944.     IPMIOCompletionUPP                ioCompletion;
  945.     OSErr                            ioResult;
  946.     long                            saveA5;
  947.     short                            reqCode;
  948.     IPMMsgRef                        msgRef;
  949.     IPMBlockType                    blockType;
  950.     unsigned short                    filler[5];
  951.     unsigned long                    refCon;
  952.     unsigned short                    filler2[3];
  953.     long                            startingOffset;
  954. };
  955. typedef struct IPMNewBlockPB IPMNewBlockPB;
  956.  
  957. struct IPMWriteMsgPB {
  958.     Ptr                                qLink;
  959.     long                            reservedH1;
  960.     long                            reservedH2;
  961.     IPMIOCompletionUPP                ioCompletion;
  962.     OSErr                            ioResult;
  963.     long                            saveA5;
  964.     short                            reqCode;
  965.     IPMMsgRef                        msgRef;
  966.     IPMAccessMode                    mode;
  967.     long                            offset;
  968.     unsigned long                    count;
  969.     Ptr                                buffer;
  970.     unsigned long                    actualCount;
  971.     Boolean                            currentBlock;
  972.     Boolean                            filler1;
  973. };
  974. typedef struct IPMWriteMsgPB IPMWriteMsgPB;
  975.  
  976. union IPMParamBlock {
  977.     struct {
  978.         Ptr                                qLink;
  979.         long                            reservedH1;
  980.         long                            reservedH2;
  981.         IPMIOCompletionUPP                ioCompletion;
  982.         OSErr                            ioResult;
  983.         long                            saveA5;
  984.         short                            reqCode;
  985.     }                                header;
  986.     IPMOpenContextPB                openContextPB;
  987.     IPMCloseContextPB                closeContextPB;
  988.     IPMCreateQueuePB                createQueuePB;
  989.     IPMDeleteQueuePB                deleteQueuePB;
  990.     IPMOpenQueuePB                    openQueuePB;
  991.     IPMCloseQueuePB                    closeQueuePB;
  992.     IPMEnumerateQueuePB                enumerateQueuePB;
  993.     IPMChangeQueueFilterPB            changeQueueFilterPB;
  994.     IPMDeleteMsgRangePB                deleteMsgRangePB;
  995.     IPMOpenMsgPB                    openMsgPB;
  996.     IPMOpenHFSMsgPB                    openHFSMsgPB;
  997.     IPMOpenBlockAsMsgPB                openBlockAsMsgPB;
  998.     IPMCloseMsgPB                    closeMsgPB;
  999.     IPMGetMsgInfoPB                    getMsgInfoPB;
  1000.     IPMReadHeaderPB                    readHeaderPB;
  1001.     IPMReadRecipientPB                readRecipientPB;
  1002.     IPMReadReplyQueuePB                readReplyQueuePB;
  1003.     IPMGetBlkIndexPB                getBlkIndexPB;
  1004.     IPMReadMsgPB                    readMsgPB;
  1005.     IPMVerifySignaturePB            verifySignaturePB;
  1006.     IPMNewMsgPB                        newMsgPB;
  1007.     IPMNewHFSMsgPB                    newHFSMsgPB;
  1008.     IPMNestMsgPB                    nestMsgPB;
  1009.     IPMNewNestedMsgBlockPB            newNestedMsgBlockPB;
  1010.     IPMEndMsgPB                        endMsgPB;
  1011.     IPMAddRecipientPB                addRecipientPB;
  1012.     IPMAddReplyQueuePB                addReplyQueuePB;
  1013.     IPMNewBlockPB                    newBlockPB;
  1014.     IPMWriteMsgPB                    writeMsgPB;
  1015. };
  1016. /*    Request codes */
  1017.  
  1018. enum {
  1019.     kIPMOpenContext                = 0x400,
  1020.     kIPMCloseContext            = 0x401,
  1021.     kIPMNewMsg                    = 0x402,
  1022.     kIPMAddRecipient            = 0x403,
  1023.     kIPMNewBlock                = 0x404,
  1024.     kIPMNewNestedMsgBlock        = 0x405,
  1025.     kIPMNestMsg                    = 0x406,
  1026.     kIPMWriteMsg                = 0x407,
  1027.     kIPMEndMsg                    = 0x408,
  1028.     kIPMOpenQueue                = 0x409,
  1029.     kIPMCloseQueue                = 0x40A,
  1030.     kIPMOpenMsg                    = 0x40B,
  1031.     kIPMCloseMsg                = 0x40C,
  1032.     kIPMReadMsg                    = 0x40D,
  1033.     kIPMReadHeader                = 0x40E,
  1034.     kIPMOpenBlockAsMsg            = 0x40F,
  1035.     kIPMReadRecipient            = 0x410,
  1036.     kIPMCreateQueue                = 0x411,
  1037.     kIPMDeleteQueue                = 0x412,
  1038.     kIPMEnumerateQueue            = 0x413,
  1039.     kIPMChangeQueueFilter        = 0x414,
  1040.     kIPMDeleteMsgRange            = 0x415,
  1041.     kIPMOpenHFSMsg                = 0x417,
  1042.     kIPMGetBlkIndex                = 0x418,
  1043.     kIPMGetMsgInfo                = 0x419,
  1044.     kIPMAddReplyQueue            = 0x41D,
  1045.     kIPMNewHFSMsg                = 0x41E,
  1046.     kIPMReadReplyQueue            = 0x421,
  1047.     kIPMVerifySignature            = 0x422
  1048. };
  1049.  
  1050. enum {
  1051.     uppIPMIOCompletionProcInfo = kPascalStackBased
  1052.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(IPMParamBlockPtr)))
  1053. };
  1054.  
  1055. #if GENERATINGCFM
  1056. #define CallIPMIOCompletionProc(userRoutine, paramBlock)        \
  1057.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIPMIOCompletionProcInfo, (paramBlock))
  1058. #else
  1059. #define CallIPMIOCompletionProc(userRoutine, paramBlock)        \
  1060.         (*(userRoutine))((paramBlock))
  1061. #endif
  1062.  
  1063. #if GENERATINGCFM
  1064. #define NewIPMIOCompletionProc(userRoutine)        \
  1065.         (IPMIOCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIPMIOCompletionProcInfo, GetCurrentArchitecture())
  1066. #else
  1067. #define NewIPMIOCompletionProc(userRoutine)        \
  1068.         ((IPMIOCompletionUPP) (userRoutine))
  1069. #endif
  1070.  
  1071. extern pascal OSErr IPMOpenContext(IPMParamBlockPtr paramBlock, Boolean async)
  1072.  THREEWORDINLINE(0x3F3C, 0x400, 0xAA5E);
  1073. extern pascal OSErr IPMCloseContext(IPMParamBlockPtr paramBlock, Boolean async)
  1074.  THREEWORDINLINE(0x3F3C, 0x401, 0xAA5E);
  1075. extern pascal OSErr IPMNewMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1076.  THREEWORDINLINE(0x3F3C, 0x402, 0xAA5E);
  1077. extern pascal OSErr IPMNewBlock(IPMParamBlockPtr paramBlock, Boolean async)
  1078.  THREEWORDINLINE(0x3F3C, 0x404, 0xAA5E);
  1079. extern pascal OSErr IPMNewNestedMsgBlock(IPMParamBlockPtr paramBlock, Boolean async)
  1080.  THREEWORDINLINE(0x3F3C, 0x405, 0xAA5E);
  1081. extern pascal OSErr IPMNestMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1082.  THREEWORDINLINE(0x3F3C, 0x406, 0xAA5E);
  1083. extern pascal OSErr IPMWriteMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1084.  THREEWORDINLINE(0x3F3C, 0x407, 0xAA5E);
  1085. extern pascal OSErr IPMEndMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1086.  THREEWORDINLINE(0x3F3C, 0x408, 0xAA5E);
  1087. extern pascal OSErr IPMOpenQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1088.  THREEWORDINLINE(0x3F3C, 0x409, 0xAA5E);
  1089. extern pascal OSErr IPMCloseQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1090.  THREEWORDINLINE(0x3F3C, 0x40A, 0xAA5E);
  1091. /* Always synchronous */
  1092. extern pascal OSErr IPMVerifySignature(IPMParamBlockPtr paramBlock)
  1093.  FIVEWORDINLINE(0x7000, 0x1f00, 0x3F3C, 0x422, 0xAA5E);
  1094. extern pascal OSErr IPMOpenMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1095.  THREEWORDINLINE(0x3F3C, 0x40B, 0xAA5E);
  1096. extern pascal OSErr IPMCloseMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1097.  THREEWORDINLINE(0x3F3C, 0x40C, 0xAA5E);
  1098. extern pascal OSErr IPMReadMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1099.  THREEWORDINLINE(0x3F3C, 0x40D, 0xAA5E);
  1100. extern pascal OSErr IPMReadHeader(IPMParamBlockPtr paramBlock, Boolean async)
  1101.  THREEWORDINLINE(0x3F3C, 0x40E, 0xAA5E);
  1102. extern pascal OSErr IPMOpenBlockAsMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1103.  THREEWORDINLINE(0x3F3C, 0x40F, 0xAA5E);
  1104. extern pascal OSErr IPMNewHFSMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1105.  THREEWORDINLINE(0x3F3C, 0x41E, 0xAA5E);
  1106. extern pascal OSErr IPMReadRecipient(IPMParamBlockPtr paramBlock, Boolean async)
  1107.  THREEWORDINLINE(0x3F3C, 0x410, 0xAA5E);
  1108. extern pascal OSErr IPMReadReplyQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1109.  THREEWORDINLINE(0x3F3C, 0x421, 0xAA5E);
  1110. extern pascal OSErr IPMCreateQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1111.  THREEWORDINLINE(0x3F3C, 0x411, 0xAA5E);
  1112. extern pascal OSErr IPMDeleteQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1113.  THREEWORDINLINE(0x3F3C, 0x412, 0xAA5E);
  1114. extern pascal OSErr IPMEnumerateQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1115.  THREEWORDINLINE(0x3F3C, 0x413, 0xAA5E);
  1116. extern pascal OSErr IPMChangeQueueFilter(IPMParamBlockPtr paramBlock, Boolean async)
  1117.  THREEWORDINLINE(0x3F3C, 0x414, 0xAA5E);
  1118. extern pascal OSErr IPMDeleteMsgRange(IPMParamBlockPtr paramBlock, Boolean async)
  1119.  THREEWORDINLINE(0x3F3C, 0x415, 0xAA5E);
  1120. extern pascal OSErr IPMAddRecipient(IPMParamBlockPtr paramBlock, Boolean async)
  1121.  THREEWORDINLINE(0x3F3C, 0x403, 0xAA5E);
  1122. extern pascal OSErr IPMAddReplyQueue(IPMParamBlockPtr paramBlock, Boolean async)
  1123.  THREEWORDINLINE(0x3F3C, 0x41D, 0xAA5E);
  1124. extern pascal OSErr IPMOpenHFSMsg(IPMParamBlockPtr paramBlock, Boolean async)
  1125.  THREEWORDINLINE(0x3F3C, 0x417, 0xAA5E);
  1126. extern pascal OSErr IPMGetBlkIndex(IPMParamBlockPtr paramBlock, Boolean async)
  1127.  THREEWORDINLINE(0x3F3C, 0x418, 0xAA5E);
  1128. extern pascal OSErr IPMGetMsgInfo(IPMParamBlockPtr paramBlock, Boolean async)
  1129.  THREEWORDINLINE(0x3F3C, 0x419, 0xAA5E);
  1130. /****************************************************************************************/
  1131. /* EXTERNAL ROUTINES */
  1132.  
  1133. enum {
  1134.     kOCESizePackedRecipient        = 830,
  1135.     kOCEPackRecipient            = 831,
  1136.     kOCEUnpackRecipient            = 832,
  1137.     kOCEStreamRecipient            = 833,
  1138.     kOCEGetRecipientType        = 834,
  1139.     kOCESetRecipientType        = 835
  1140. };
  1141.  
  1142. extern pascal unsigned short OCESizePackedRecipient(const OCERecipient *rcpt)
  1143.  THREEWORDINLINE(0x303C, 830, 0xAA5C);
  1144. /*
  1145. Take an OCERecipient (scatter) and (gather) stream into the specified
  1146. buffer.  It is assumed that there is sufficient space in the buffer (that is
  1147. OCESizePackedRecipient).  Safe to pass dereferenced handle(s).
  1148. */
  1149. extern pascal unsigned short OCEPackRecipient(const OCERecipient *rcpt, void *buffer)
  1150.  THREEWORDINLINE(0x303C, 831, 0xAA5C);
  1151. /*
  1152. Take a packed OCERecipient and cast a the OCERecipient frame over it. Returns
  1153. amBadDestId if it doesn't look like an OCERecipient. Safe to pass dereferenced
  1154. handle(s).
  1155. */
  1156. extern pascal OSErr OCEUnpackRecipient(const void *buffer, OCERecipient *rcpt, RecordID *entitySpecifier)
  1157.  THREEWORDINLINE(0x303C, 832, 0xAA5C);
  1158. /*
  1159. Take an OCERecipient (scatter) and (gather) stream using the specified
  1160. function.  Safe to pass dereferenced handle(s).  If streamer function returns
  1161. OCEError OCEStreamRecipient stops execution and passes the error back to the caller
  1162. */
  1163. typedef pascal OSErr (*OCERecipientStreamerProcPtr)(void *buffer, unsigned long count, Boolean eof, long userData);
  1164.  
  1165. #if GENERATINGCFM
  1166. typedef UniversalProcPtr OCERecipientStreamerUPP;
  1167. #else
  1168. typedef OCERecipientStreamerProcPtr OCERecipientStreamerUPP;
  1169. #endif
  1170.  
  1171. enum {
  1172.     uppOCERecipientStreamerProcInfo = kPascalStackBased
  1173.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  1174.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void*)))
  1175.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned long)))
  1176.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean)))
  1177.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  1178. };
  1179.  
  1180. #if GENERATINGCFM
  1181. #define NewOCERecipientStreamerProc(userRoutine)        \
  1182.         (OCERecipientStreamerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppOCERecipientStreamerProcInfo, GetCurrentArchitecture())
  1183. #else
  1184. #define NewOCERecipientStreamerProc(userRoutine)        \
  1185.         ((OCERecipientStreamerUPP) (userRoutine))
  1186. #endif
  1187.  
  1188. #if GENERATINGCFM
  1189. #define CallOCERecipientStreamerProc(userRoutine, buffer, count, eof, userData)        \
  1190.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppOCERecipientStreamerProcInfo, (buffer), (count), (eof), (userData))
  1191. #else
  1192. #define CallOCERecipientStreamerProc(userRoutine, buffer, count, eof, userData)        \
  1193.         (*(userRoutine))((buffer), (count), (eof), (userData))
  1194. #endif
  1195.  
  1196. typedef OCERecipientStreamerUPP OCERecipientStreamer;
  1197.  
  1198. extern pascal OSErr OCEStreamRecipient(const OCERecipient *rcpt, OCERecipientStreamer stream, long userData, unsigned long *actualCount)
  1199.  THREEWORDINLINE(0x303C, 833, 0xAA5C);
  1200. /* Get the OCERecipient's extensionType. Safe to pass dereferenced handle(s).*/
  1201. extern pascal OSType OCEGetRecipientType(const CreationID *cid)
  1202.  THREEWORDINLINE(0x303C, 834, 0xAA5C);
  1203. /*
  1204. Set the OCERecipient's extensionType in the specified cid.  (Note: we do NOT
  1205. check for a nil pointer).  If the extensionType is 'entn', the cid is assumed
  1206. to be "valid" and is not touched.  Note: to properly handle non 'entn''s this
  1207. routine must and will zero the high long (source) of the cid! Safe to pass
  1208. dereferenced handle(s).
  1209. */
  1210. extern pascal void OCESetRecipientType(OSType extensionType, CreationID *cid)
  1211.  THREEWORDINLINE(0x303C, 835, 0xAA5C);
  1212.  
  1213. #if PRAGMA_IMPORT_SUPPORTED
  1214. #pragma import off
  1215. #endif
  1216.  
  1217. #if PRAGMA_ALIGN_SUPPORTED
  1218. #pragma options align=reset
  1219. #endif
  1220.  
  1221. #ifdef __cplusplus
  1222. }
  1223. #endif
  1224.  
  1225. #endif /* __OCEMESSAGING__ */
  1226.